package com.yjhealth.libs.businessdemo.business;

import android.Manifest;
import android.os.Build;
import android.os.Bundle;

import com.yjhealth.libs.businessdemo.R;
import com.yjhealth.libs.commonlib.base.activity.BaseActivity;
import com.yjhealth.libs.core.toast.ToastUtil;
import com.yjhealth.libs.core.core.activity.CoreActivity;
import com.yjhealth.libs.core.utils.PermissionUtil;

public class DemoPermissionActivity extends BaseActivity {
    private final String[] BASIC_PERMISSIONS = new String[]{Manifest.permission.CAMERA};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.businessdemo_activity_demo_permission);


        boolean check = PermissionUtil.checkPermission(activity, BASIC_PERMISSIONS);
        ToastUtil.toast("persimission=" + check);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            PermissionUtil.requestPermission(activity,BASIC_PERMISSIONS,1);
        }
    }

    @Override
    protected void onRefreshView() {

    }
}
